# -*- coding: utf-8 -*-
from odoo import api, fields, models, _

class StockMove(models.Model):
    _inherit = 'stock.move'


    @api.multi
    def stock_reserve(self):
        if self.state not in ('draft', 'cancel', 'done'):
            self.action_assign()


    @api.multi
    def do_un_stock_reserve(self):
        self.do_unreserve()


    @api.multi
    def do_cancel(self):
        self.do_unreserve()
        self.action_cancel()
